<?php

declare(strict_types=1);

namespace App\CustHub\Request;

use Mine\MineFormRequest;
use function Swoole\Coroutine\Http\request;

class RoomRequest extends MineFormRequest
{
    public function inviteListRules(): array
    {
        return [
            'room_wxid' => 'required'
        ];
    }

    public function detailRules(): array
    {
        return [
            'id' => 'required'
        ];
    }

    public function getRobotPageListRules()
    {
        return [
            'id' => 'required'
        ];
    }

    public function inviteDetailRules(): array
    {
        return [
            'room_wxid' => 'required',
            'inviter_id' => 'required'
        ];
    }

    public function exportRoomMemberRules()
    {
        return [
            'room_wxid' => 'required',
        ];
    }

    public function syncRoomRules()
    {
        return [
            'robot_ids' => 'required'
        ];
    }

    public function behaviorLogRules(): array
    {
        return [
            'id' => 'required'
        ];
    }

    public function getRoomRobotListRules(): array
    {
        return [
            'id' => 'required',
        ];
    }

    public function outRoomRules(): array
    {
        return [
            'id' => 'required',
            'robot_id' => 'required'
        ];
    }

    public function getTransferableRoomsRules(): array
    {
        return [
            'from_robot_id' => 'required',
            'to_robot_id' => 'required'
        ];
    }

    public function getAdminAssignableRooms():array
    {
        return $this->getTransferableRoomsRules();
    }

    public function changeRoomOwnerRules(): array
    {
        $rules = [
            'room_ids' => 'required'
        ];

        return array_merge($rules, $this->getTransferableRoomsRules());
    }

    public function setRoomAdminRules(): array
    {
        return $this->changeRoomOwnerRules();
    }

    public function editRoomNameRules(): array
    {
        return [
            'room_ids' => 'required',
            'type' => 'required|in:0,1',
            'number_start' => 'required_if:type,0',
            'room_name' => 'required_if:type,0',
            'keyword' => 'required_if:type,1',
            'replace_str' => 'required_if:type,1',
        ];
    }

    public function batchOutRoomRules(): array
    {
        return [
            'robot_id' => 'required',
            'room_ids' => 'required'
        ];
    }

    public function fetchCorpRoomMembersRules():array
    {
        return [
            'id' => 'required',
            'robot_id' => 'required'
        ];
    }

    public function saveContactsRules(): array
    {
        return [
            'room_ids' => 'required'
        ];
    }

    public function removeFromContactsRules(): array
    {
        return $this->saveContactsRules();
    }

    public function batchDelRoomRules(): array
    {
        return [
            'room_ids' => 'required'
        ];
    }


    public function getQrCodeRules()
    {
        return [
            'id' => 'required'
        ];
    }

    public function getOwnerAndAdminRobotList()
    {
        return [
            'id' => 'required',
        ];
    }

    public function setRoomDoNotDisturbRules()
    {
        return [
            'id' => 'required',
            'switch' => 'required|in:0,1',
        ];
    }

    public function publishRoomNoticeRules()
    {
        return [
            'id' => 'required',
            'robot_id' => 'required',
            'notice' => 'required'
        ];
    }

    public function pushRoomMsgRules()
    {
        return [
            'id' => 'required',
            'robot_ids' => 'required',
            'content' => 'required'
        ];
    }

    public function getRobotListRules()
    {
        return [
            'id' => 'required',
        ];
    }

    public function renameRoomRules()
    {
        return [
            'id' => 'required',
            'room_name'=> 'required',
            'robot_id' => 'required',
            'is_at_all' => 'required|in:0,1'
        ];
    }
}